<script setup lang="ts">
const myModal = ref()
const captchaRef = ref()

//  myModal.value?.cancelModal()
const showModal = () => {
  myModal.value?.showModal()

  setTimeout(() => {
    console.log('_dx', _dx)

    // _dx.Captcha(captchaRef.value, {
    //   appId: '1c880deab4e4eced2c04786567ee7046',
    //   success: token => {
    //     console.log('token=', token)
    //   },
    // })
  }, 1000)
}

defineExpose({
  showModal,
})
</script>

<template>
  <MyModal ref="myModal" title="顶象验证">
    <template #content>
      <a-spin>
        <div ref="captchaRef" style="min-height: 150px"></div>
        <remote-js src="https://cdn.dingxiang-inc.com/ctu-group/captcha-ui/index.js"></remote-js>
      </a-spin>
    </template>
  </MyModal>
</template>
